package com.xblog.chatbox.vlmp.service;


import com.xblog.chatbox.vlmp.conversation.Conversation;
import com.xblog.chatbox.vlmp.conversation.ConversationPayload;
import com.xblog.chatbox.vlmp.conversation.ConversationPayloadFeedbacks;
import com.xblog.chatbox.vlmp.conversation.ConversationRequest;
import com.xiaowu.xblog.constant.AuthorizationContext;
import com.xiaowu.xblog.constant.UserContext;
import com.xiaowu.xblog.model.PagerResult;
import com.xiaowu.xblog.utils.Result;

import java.util.List;

/**
 * @author wupy
 **/
public interface VlmpAgentService {

    /**
     * 智能体对话
     */
    Result<reactor.core.publisher.Flux<String>> completions(UserContext authorization, ConversationRequest conversationRequest);

    /**
     * 获取会话信息
     *
     * @param conversationId 会话ID
     */
    Conversation getConversation(String conversationId);

    /**
     * 获取当前登录用户会话列表
     *
     * @param context 登录信息
     * @param topic         会话主题
     */
    List<Conversation> getConversationList(UserContext context, String topic);

    /**
     * 删除会话信息
     *
     * @param conversationId 会话ID
     */
    void delete(UserContext context, String conversationId);


    /**
     * 重命名会话信息
     *
     * @param conversation 会话信息
     */
    void rename(UserContext context, Conversation conversation);

    /**
     * 获取当前登录用户会话列表
     *
     * @param topic 会话主题
     * @param size  获取最近多少条数据
     */
    List<Conversation> getLatestConversationList(UserContext context, String topic, int size);

    /**
     * 获取当前登录用户会话列表
     */
    PagerResult<ConversationPayload> getConversationPayloadList(UserContext context, String conversationId, String oldestPayloadId);


    /**
     * 根据会话ID获取最近的聊天内容
     *
     * @param conversationId 会话Id
     * @param size           获取最近多少条数据
     */
    List<ConversationPayload> getLatestConversationPayloadList(UserContext context, String conversationId, int size);

    /**
     * 反馈当前对话内容
     *
     * @param feedbacks 反馈信息
     */
    void feedbacks(UserContext context, ConversationPayloadFeedbacks feedbacks);
}
